Welcome to Bryton in three hours.
OK, here is where we are training our network, so all we have to do is just use this feed function,
net that.
And here I'm going to actually fit this fit function with the necessary variables that we already calculated
and prepare.
And instead of having all of these inputs of this function back to back in one line, I show them on
different lines.
And this is one kind of practices here that you can actually practice having these ansible lines vertically.
So it goes in a more organized way.
The first variable here is our input calculated of training.
The output capability of our training is the second variable here.
We define the total number of iterations called Epic's, which is its underlying Val.
And I believe that we have defined it to be 10.
It is not large, so let's make it one hundred and this one more time.
So now our total number of iterations is one hundred.
Here we define our batch size, which is our BTE underlying size, which was 16 actually here.
Then we are defining our verbals.
We want to see the outputs in each situation and we want to shaffir it.
So we have also is on Val to be true here.
So I have to do it.
Just run this cell and is actually saves everything into that history by everything.
I mean the information regarding our training process, like the last values in each iteration, everything's
going to be actually saved into that historic.
So let me run this and here we go.
We have equal number one, two, three out of 100.
And what you see here is this 1063, which is the total number of batches since our batch size was 16.
Then we have the total number of matches automatically computed to be 1063.
And you can see that for each Époque or iteration, it goes through all of our patches.
And each time when we go and start one époque, it also shuffles them.
So all we have to do here is just to wait until we are done with 100 iterations here.
But by the way, you can also see the last value here, which because of the Adam optimizer, we expect
that it is becoming less and less as in, as you noted, this is an stochastic learning.
So you might get lower and higher values, but eventually we can actually converge to some optimum values
and its less function going to be reduced over and over.
And once it doesn't actually produce any more, then perhaps that's the time that we can start the training.
So like I said, we just need to wait for a few more airports and wait until this training is being
completed.
OK, our network has been learning for 100 iterations.
It has been done and lost.
Value has been changed from a value in a scale of point zero three five to another value in a scale
of point zero zero nine four.
So it has been done here.
We can predict our estimated data.
So now that our network has been trained, we can use the function, predict and then put their the
input of the calibrated data evenly so it actually computes the estimated values of our testing data.
And here I'm actually using the E.S. attached to the Raw Data to show the estimated values.
So let's run DSL and then here we can have some interesting plots.
So there are important matplotlib areas still here.
So I'm going to create a figure.
And in this figure, I want to plot the data output of testing calibrated versus the data estimation
test and calibrate it.
So if our testing estimation is exactly the same as our actual output of the testing in the calibrated
domain, then we expect that when we plot them against each other, they all fall on by sector of the
figure.
And if there is a distance between each point on this flight and the BI sector, and that actually represents
the error.
So the closer our points are to the biosecure, that means that we have a better estimation here.
We also plot our dissector using a red line.
I'm going to actually having a range beyond 011 a little bit more like minus point two and one point
two, just to make sure that if we had some estimations that are beyond our calibrator range of 011
and here I have a label for you, the real testing outputs test our X's and calibrated ones.
So here I have for you the X label and very label.
So the X label is actually our testing outputs, the calibrated one, the real one.
And also on the Y axis, we have the estimated testing outputs calibrated and we want the font to be
fourteen.
So let's run this.
And here we go.
As you see that this is my real testing outputs in calibrated domain and estimated testing outputs in
the calibrated domain.
And you see the majority of points are kind of fairly around this by sector, meaning that after 100
iterations we had some kind of good estimation.
You want to point.
To be even closer to the by sector, then you have to have the network to be trained more, or you may
want to modify the size of the network, but you have to always be careful about the phenomenon called
Overfitting, which is not a subject we cover in this lecture or next lectures in discourse.
But you can always look online about it and educate yourself about that in this cell.
We want to plot iteration versus our loss.
And if you remember, we saved our class values all in our history here.
So in the history, we have all the information regarding how this network has been learned and during
the process, it has saved all of those lost values we have seen as the output of the training process.
So we have them all here.
And again, I shall create a figure here with the size of five and five.
And if you call history that history and this is a dictionary, and if you use the key laws here, you
have access to all the lost values of different iterations.
You don't have to define an X and Y, just define the last values here by calling the history story
with a key of loss and it automatically actually gets the X values to be the total number of values
in that period coming out of these highlighted history.
So we have a title for this plot.
We call it Modulus Font Size of Tiny.
Our variable is larger than our X label is iteration number, all with font of twenty.
And I have to do is just random cell.
And here we have our iteration number versus the last.
And as you see, our model is being learned and learned over the number of iterations.
And maybe if we go more than 100 iterations, the trajectory shows that the network might learn more.
But you have to be careful about the phenomenon called Overfitting, which we are not actually covering
in this course.
But you are welcome to look for it online and to see how we can prevent that, to make sure our machine
learning works without any problem.
So this is not the end of it.
There are tons of stuff online that you can read about how to run your machine learning models and how
to make it even more fancy so you can look into CRUS Documentation's at Keirstead Io and also Skillern
Library and other library similar to Tenso, followed by going to Saikat that learned that Orji and
educate yourself about these libraries as well.
In this lecture, you'll learn about how to develop a shallow neural network and deep neural network
using tenso across in Python for a regression problem.
In the next lecture, we will learn about tenso across four classification neural networks.
Thank you for your attention.
See you all in the next lecture.